<?php
//to render shopping cart total and article count in each page
//require("storescripts/cart_script.php");
require("storescripts/checkout_script.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Cart</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<!-- start of javascript -->
<script type="text/javascript" language="javascript"> 
// validating forms before processing to a PHP script
function validateMyForm ( ) { 
    var isValid = true;
    if ( document.myForm.card_name.value == "" ) { 
	    alert ( "Please indicate card member name" ); 
	    isValid = false;
    } else if ( document.myForm.cardnum1.value == "" && document.myForm.cardnum2.value == "" && document.myForm.cardnum3.value == "" && document.myForm.cardnum4.value == "") { 
				alert ( "Please indicate complete card number" ); 
				isValid = false;
	} else if ( document.myForm.card_sec.value == "" ) { 
            alert ( "Please indicate card security number" ); 
            isValid = false;
    } 
    return isValid;
}
</script>
<!--end of script -->
</head>

<body>
<!-- Shell -->
<div class="shell">
  <!-- Header -->
  <div id="header">
    <h1 id="logo"><a href="index.php">Luvo Fashion</a></h1>
    <!-- Cart -->
    <div id="cart"> <a href="cart.php" class="cart-link">Your Shopping Cart</a>
      <div class="cl">&nbsp;</div>
      <span>Articles: <strong><?php echo $cartArticles;?></strong></span> &nbsp;<span><strong><?php echo $cartTotal;?></strong></span>
	</div>
    <!-- End Cart -->
    <!-- Navigation -->
    <div id="navigation">
      <ul>
        <li><a href="index.php">Home</a></li>
        <li><a href="about_us.php">About Us</a></li>
        <li><a href="faq.php">FAQ</a></li>
		<li><a href="gallery.php">Gallery</a></li>
        <li><a href="contact.php">Contact</a></li>
		<li><a href="account.php">My Account</a></li>
      </ul>
    </div>
    <!-- End Navigation -->
  </div>
  <!-- End Header -->
  <!-- Main -->
  <div id="main">
   	<!-- Content -->
	<div id="content">	
		<br />
		<h2>Purchase Summary</h2>
		<br />
		<table width="100%" border="1" cellpadding="6" cellspacing="0">
		  <tr align="center">
		    <td width="150" class="cartTable">Product</td>
		    <td width="300" class="cartTable">Product Description</td>
		    <td width="65" class="cartTable">Unit Price</td>
		    <td width="65" class="cartTable">Quantity</td>
		    <td width="65" class="cartTable">Total</td>
	      </tr>
          <?php echo $cartOutput;?>
	  </table>
	<br />
	<div align="right"><h3><?php echo $cartTotal; ?></h3><br />
			<form action="cart.php" method="post">
				<input name="backToCart" type="submit" value="Back to Cart">
			</form>
	</div> <br /> 
	<div align="center">
		<div style="margin:10px; text-align:left;">
		<br />
		<h2>Billing Information</h2>
		</div>
		<div style="margin:10px; text-align:left;">
		<table>
		<?php echo $customerDetails;?>
		
		</table>
		<br>
		<form action="edit_account.php" method="post">
			<input name="editDetails" type="submit" value="Edit Details" />
		</form>
		</div>
		<br>
		<div style="margin:10px; text-align:left;">
		<h2>Payment Options:</h2><br>
		<table cellspacing="10">
		<tr>
			<td colspan=2>
				<form action="storescripts/payment_details.php" method="post" name="myForm">
				<label>Payment Options:</label><br>
				<select name="card">
				    <option value="Visa">Visa</option>
				    <option value="Master">Master Card</option>
				    <option value="Amex">American Express</option>
				</select><br>
				<label>Card Member Name:</label><br>
					<input name="card_name" type="text" maxlength="60" size="60"/><br>
				<label>Card Number:</label><br>
					<input name="card_num1" type="text" maxlength="4" size="4"/>  -  <input name="card_num2" type="text" maxlength="4" size="4"/>  -  <input name="card_num3" type="text" maxlength="4" size="4"/>  -  <input name="card_num4" type="text" maxlength="4" size="4"/><br>
				<label>Card Expiry:</label><br>
					<select name="month">
					    <option value="01">Jan</option>
						<option value="02">Feb</option>
						<option value="03">Mar</option>
						<option value="04">Apr</option>
						<option value="05">May</option>
						<option value="06">June</option>
						<option value="07">July</option>
						<option value="08">Aug</option>
						<option value="09">Sep</option>
						<option value="10">Oct</option>
						<option value="11">Nov</option>
						<option value="12">Dec</option>
					</select>  /  
					<select name="year">
					    <option value="2012">2012</option>
						<option value="2013">2013</option>
						<option value="2014">2014</option>
						<option value="2015">2015</option>
						<option value="2016">2016</option>
					</select><br>
				<label>Card Security:</label><br>
					<input name="card_sec" type="text" maxlength="3" size="3"/><br><br>
					<input name="confirmBtn" type="submit" value="Confirm" onclick="javascript:return validateMyForm();"/>
				</form>
			</td>
		</tr>
		</form>
		</table>
		</div>
		</div>
    </div>
    <!-- End Content -->
    <!-- Sidebar -->
    <div id="sidebar">
      <!-- Login/Register -->
<!-- if no user log on show below--><!-- End Login -->
      <!-- Categories -->
      <div class="box categories">
        <h2>Categories<span></span></h2>
        <div class="box-content">
          <ul>
            <li>MEN's</li>
            <li><a href='gallery.php?cat=men&subcat=clothing'>Clothes</a></li>
			<li><a href='gallery.php?cat=men&subcat=shoes'>Shoes</a></li>
            <li><a href='gallery.php?cat=men&subcat=bags'>Bags</a></li>
            <li><a href='gallery.php?cat=men&subcat=accessories'>Accessories</a></li>
            <li>WOMEN's</li>
			<li><a href='gallery.php?cat=women&subcat=clothing'>Clothes</a></li>
            <li><a href='gallery.php?cat=women&subcat=shoes'>Shoes</a></li>
            <li><a href='gallery.php?cat=women&subcat=bags'>Bags</a></li>
            <li class="last"><a href='gallery.php?cat=women&subcat=accessories'>Accessories</a></li>
          </ul>
        </div>
      </div>
      <!-- End Categories -->
    </div>
    <!-- End Sidebar -->
    <div class="cl">&nbsp;</div>
  </div>
  <!-- End Main -->
  <!-- Footer -->
  <?php include_once("template_footer.php"); ?>
  <!-- End Footer -->
</div>
<!-- End Shell -->
</body>
</html>
